package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.domain.StrategyCatalog;
import cn.wolfcode.trip.base.domain.StrategyDetail;
import cn.wolfcode.trip.base.service.IStrategyCatalogService;
import cn.wolfcode.trip.base.service.IStrategyDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("strategyCatalogs")
public class StrategyCatalogController {
    @Autowired
    private IStrategyCatalogService catalogService;

    @Autowired
    private IStrategyDetailService detailService;

    @GetMapping("/{strategyId}")
    public List<StrategyCatalog> getCatalog(@PathVariable Long strategyId){
        List<StrategyCatalog> catalogs = catalogService.getCatalogById(strategyId);
        return catalogs;
    }

    @GetMapping("/{detailId}/details")
    public StrategyDetail getContentById(@PathVariable Long detailId){
        return detailService.getContentById(detailId);
    }


}
